﻿Imports BUS
Public Class frmxlcapnhattacgia

    Private _matacgia As Integer
    Public Property MaTacGia() As Integer
        Get
            Return _matacgia
        End Get
        Set(ByVal value As Integer)
            _matacgia = value
        End Set
    End Property

    Private Sub SimpleButton_DongY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton_DongY.Click
        If TextEdit_TenTacGia.Text <> "" Then
            Dim sql As String = "Update TACGIA Set TenTacGia=" + "'" + TextEdit_TenTacGia.Text + "'" + " Where MaTacGia=" + _matacgia.ToString()
            Dim bus As New TacGiaBUS()
            Dim kq As Integer = bus.CapNhatTacGia(sql)
            If kq = 1 Then
                MessageBox.Show("Câp nhật thành công !")
                Me.Close()
            Else
                MessageBox.Show("Cập nhật thất bại !")
            End If
        Else
            MessageBox.Show("Nhập tên tác giả !")
        End If
    End Sub

    Private Sub SimpleButton_Thoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton_Thoat.Click
        Close()
    End Sub
End Class